/**
 * 版权所有(C)，上海海鼎信息工程股份有限公司，2007，所有权利保留。
 * 
 * 项目名：	rumba
 * 文件名：	Cartridge.java
 * 模块说明：	
 * 修改历史：
 * Apr 26, 2007 - lxm - 创建。
 */
package com.hd123.rumba.cartridge;

import com.hd123.rumba.exception.StringTooLongException;
import com.hd123.rumba.runtime.BaseEntity;
import com.hd123.rumba.util.Version;

/**
 * 构件包 | 实体 | 实现类
 * 
 * @author lxm
 * 
 */
public class Cartridge extends BaseEntity implements ICartridge {

  private String assignedUuid = null;
  private String prefix;
  private String caption;
  private Version version = new Version("0.0.0.0");
  private String remark;
  private Boolean upgrading = Boolean.FALSE;

  public Cartridge() {
    super();
    this.lengthUuid = CCartridge.LENGTH_UUID;
  }

  public String getAssignedUuid() {
    return assignedUuid;
  }

  public void setAssignedUuid(String assignedUuid) throws StringTooLongException {
    if (assignedUuid != null)
      assignedUuid = truncate(assignedUuid, CCartridge.LENGTH_UUID, "uuid", CCartridge.CAPTION_UUID);
    this.assignedUuid = assignedUuid;
  }

  public String getCaption() {
    return caption;
  }

  public void setCaption(String caption) throws StringTooLongException {
    if (caption != null)
      caption = truncate(caption, CCartridge.LENGTH_CAPTION, "caption", CCartridge.CAPTION_CAPTION);
    this.caption = caption;
  }

  public String getPrefix() {
    return prefix;
  }

  public void setPrefix(String prefix) throws StringTooLongException {
    if (prefix != null)
      prefix = truncate(prefix, CCartridge.LENGTH_PREFIX, "prefix", CCartridge.CAPTION_PREFIX);
    this.prefix = prefix;
  }

  public String getRemark() {
    return remark;
  }

  public void setRemark(String remark) {
    this.remark = remark;
  }

  public Boolean getUpgrading() {
    return upgrading;
  }

  public void setUpgrading(Boolean upgrading) {
    this.upgrading = upgrading;
  }

  public Version getVersion() {
    return version;
  }

  public void setVersion(Version version) {
    this.version = version;
  }

}
